package org.opens.guava.utilites.eventBus.events;

import com.google.common.eventbus.EventBus;
import org.junit.Test;
import org.opens.guava.utilites.eventBus.base.Apple;
import org.opens.guava.utilites.eventBus.listeners.DeadEventListener;
import org.opens.guava.utilites.eventBus.listeners.EatFruitListener;

public class DeadEventBusExample {

    /**
     * 功能:
     *      测试DeadEventBus的作用.
     * 输出:
     *      13:32:58.325 [main] INFO org.opens.guava.utilites.eventBus.listeners.DeadEventListener - EventBus{DeadEventBus}
     *      113:32:58.325 [main] INFO org.opens.guava.utilites.eventBus.listeners.DeadEventListener - hello
     * 说明:
     *      1. 可以发现, 使用DeadEvent对象可以直接获取时间总线对象和参数.
     */
    @Test
    public void test1() {
        final EventBus eventBus = new EventBus("DeadEventBus");
        eventBus.register(new DeadEventListener());
        eventBus.post("hello");
    }

}
